package cn.tedu.tw.wyy;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class AppRefField {
    public static void main(String[] args) throws Exception{
        Class<?> C=Class.forName("cn.tedu.tw.wyy.Human");
        Object o=C.newInstance();
        Field name =C.getDeclaredField("name");
        name.setAccessible(true);
        name.set(o,"Coco");
        Method getName =C.getMethod("getName");
        Object result = getName.invoke(o);
        System.out.println(result);
    }
}
